package com.tenxun.controller;

import com.tenxun.pojo.Stu;
import com.tenxun.service.StuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@CrossOrigin(origins = "*")
public class Controller {

    @Autowired
    private StuService service;

    @RequestMapping("/stu/list/{num}")
    public List<Stu> list(@PathVariable Integer num){
        return service.list(num);
    }
    @RequestMapping("/stu")
    public String stu(){
        return "加油，伍鸿杰!";
    }
}
